package com.wenhao.meituan;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author Wenhao Tong
 * @create 2021-08-07 22:11
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        if (x > y) {
            int temp = x;
            x = y;
            y = temp;
        }
        int[] a = new int[n];
        for (int i = 0;i < n;i++) {
            a[i] = scanner.nextInt();
        }
        Arrays.sort(a);
        for (int i = x;i <= y;i++) {
            if (n >= i + x && n <= i + y) {
                System.out.println(a[i - 1]);
                return;
            }
        }
        System.out.println(-1);
    }
}
